from django.conf.urls.defaults import *
from dj import views, Feeds
from dj.blog import views as blogviews
#create a seperate patterns sequence for all urls underneath /articles
#
articlepatterns = patterns('',
    (r'(?P<year>\d{4})/(?P<month>\d{2})/$',blogviews.archive),
    (r'(?P<year>\d{4})/$',blogviews.archive),
    (r'(?P<title>\S*)/h',blogviews.article),
)
# a seperate partterns sequesnce for /preview
previewpatterns = patterns('',
    (r'^$', blogviews.previewBlog),
    (r'^pages/(?P<step>\d*)/$',blogviews.previewBlog),
    (r'preview/(?P<title>\S*)/$',blogviews.preview),
)
urlpatterns = patterns ('dj.urls',
    (r'^$',blogviews.blog),
    (r'^pages/(?P<step>\d*)/$',blogviews.blog),
    (r'^articles/',include(articlepatterns)),
    (r'^preview/',include(previewpatterns)),
    (r'^feed/$',Feeds.LatestEntriesFeed()),
)

